#!/bin/bash

sudo sed -i -e 's/rsync.macports.org/mirror.nju.edu.cn/' /opt/local/etc/macports/sources.conf
sudo sed -i -e 's/^#rsync_server.*$/rsync_server mirror.nju.edu.cn/' /opt/local/etc/macports/macports.conf

sudo bash -c 'cat >/opt/local/etc/macports/archive_sites.conf <<EOF
name                	My Source
urls                	https://mirror.nju.edu.cn/macports/packages/
EOF'

echo 'export PATH=$PATH:/opt/local/bin' >>~/.zprofile
echo 'export PATH=$PATH:/opt/local/sbin' >>~/.zprofile

: <<COMMENT

bash -c "$(curl -fsSL https://gitee.com/hevey88/install_script/raw/main/macos/config_macports.sh)"

COMMENT
